package com.dsg.dao.apply;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsg.common.dto.OldCardDto;
import com.dsg.entity.apply.DsgApplyCar;
import com.dsg.entity.apply.DsgApplyCard;
import com.dsg.entity.dto.*;
import com.dsg.util.BaseDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 油咭資料 Mapper 接口
 * </p>
 *
 * @author system
 * @since 2020-07-23
 */
@Repository
public interface DsgApplyCardMapper extends BaseDao<DsgApplyCard> {
    Page<ChangeCardDto> selectChangeCard(Page<ChangeCardDto> page, ChangeCardDto en);

    DsgApplyCard selectReturnCardSC(String cardNo, String entCode, String userId);

    List<ReturnCardDto> selectReturnCard(String nodeName, String cardNo, String cardFaceName, Integer carOilType,
                                         String carNo, Boolean isReturn, String ownsId,String cardType, String userId);
    /**
     * 重覆的記賬卡
     * @param car
     * @param cardType
     * @param cardOid
     * @return
     */
    DsgApplyCard getDupCardBook(DsgApplyCar car, String cardType, String cardOid);

    OldCardDto getOldCard(OldCardDto dto);

    /**
     * 重覆的現金卡
     * @param car
     * @param cardType
     * @param cardOid
     * @return
     */
    DsgApplyCard getDupCardCash(DsgApplyCar car, String cardType, String cardOid);

    /**
     * 客戶資料-油卡列表
     * @param dto
     * @return
     */
    List<CusCardDto> selectCusCard(CusCardSearchDto dto);

    String getOwnsIdByCardNo(String cardNo);

    List<CardRecordDto> selectCardRecord(Integer cardType, Integer appType, Integer cardStatus, Integer dedStatus, String entCode);

    /**
     * 咭號查詢卡信息和客戶編號
     * @param dsgApplyCard
     * @return
     */
    List<DsgApplyCard> selectApplyCardAndCusNo(@Param("en") DsgApplyCard dsgApplyCard);

    /**
     * 查询咭列表
     * @param page
     * @param dsgApplyCard
     * @return
     */
    List<DsgApplyCard> selectDsgApplyCard(Page<DsgApplyCard> page, @Param("en") DsgApplyCard dsgApplyCard);
}
